package com.frxuexi.lib_base.net

import com.frxuexi.lib_base.entity.CommentBean
import com.frxuexi.lib_base.entity.ResShop
import com.frxuexi.lib_base.entity.VideoBean
import okhttp3.RequestBody
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.POST
import retrofit2.http.Query

interface VideoApiService {

    @GET("/video/findVideos?pageSize=10")
    suspend fun getVideos(@Query("currentPage") page:Int):ResShop<VideoBean>

    @GET("/video/findVideoByName")
    suspend fun searchVideo(@Query("keywords")keywords:String):ResShop<VideoBean>

    @POST("/comment/comment")
    suspend fun addComment(@Body body: RequestBody):ResShop<CommentBean>

    @POST("/fav/love")
    suspend fun zan(@Query("videoId")videoId:Int):ResShop<String>

    @POST("/fav/nolove")
    suspend fun nozan(@Query("videoId")videoId:Int):ResShop<String>

    @GET("/comment/getCommentByVideoId")
    suspend fun getComments(@Query("videoId")videoId:Int):ResShop<CommentBean>
}